-
Notifications
You must be signed in to change notification settings - Fork 7
feat(autofix): Fix additional deprecated Core APIs #639
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
7c8c5bc
to
bb20759
Compare
fc44eab
to
5fa49bb
Compare
"use strict"; | ||
|
||
sap.ui.getCore().getLibraryResourceBundle("library.with.custom.paths", "en_US"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is currently not fixed, but it should be, right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Will be resolved with: #675
test/fixtures/linter/projects/library.with.custom.paths/src/main/js/Example.js
Outdated
Show resolved
Hide resolved
} | ||
|
||
return fixHints; | ||
} | ||
|
||
function extractKeyValuePairs(jsonLikeStr: string) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We already have the relevant information accessible via AST nodes, so I don't think we should parse the argument ourselves here. The input is based on node.getText()
. We even have already code that can analyze object structures, which is used for certain checks in SourceFileLinter
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Will be resolved in #675
name: fixHints.exportCodeToBeUsed.args[0].value.replace(/^['"]+|['"]+$/g, ""), | ||
url: libOptionsExpression.url, | ||
}; | ||
fixHints.exportCodeToBeUsed.args[0].value = JSON.stringify(newArg); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here the comments in the code get lost. Also, the used quotes in the code will be always replaced by double-quotes.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Will be resolved in #675
extractKeyValuePairs(fixHints.exportCodeToBeUsed.args[1].value) as {async: boolean; url?: string}; | ||
if (libOptionsExpression.async === true) { | ||
const newArg = { | ||
name: fixHints.exportCodeToBeUsed.args[0].value.replace(/^['"]+|['"]+$/g, ""), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Using back-ticks as first arg (library name) results into quoted backticks.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Will be resolved in #675
43442c9
to
756264a
Compare
d0120ff
to
b272a5a
Compare
756264a
to
cbc6e6a
Compare
0c07e32
to
cb85a25
Compare
8372914
to
79ea741
Compare
f033503
to
0b46e18
Compare
c815258
to
1eafe45
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
JIRA: CPOUI5FOUNDATION-991
Enhances #671 by enabling more complex autofixes where migration depends on the provided arguments.
Resolves partially: #619
Follow up PRs:
#675